package thread4;

public class Account {
	private String bank = "icbc";
	private String acno;
	private int balance;// 余额

	public Account(String acno, int balance) {
		super();
		this.acno = acno;
		this.balance = balance;
	}

	// 取钱
	public void takeMoney(int m) {
		balance -= m;
	}

	// 存钱
	public void deposit(int m) {
		this.balance += m;
	}

	public String getAcno() {
		return acno;
	}

	public void setAcno(String acno) {
		this.acno = acno;
	}

	public int getBalance() {
		return balance;
	}

	public void setBalance(int balance) {
		this.balance = balance;
	}

	@Override
	protected void finalize() throws Throwable {

		System.out.println("对象被彻底清除了");
		super.finalize();
	}
}
